package com.bigfish.gbs.dao;

import com.bigfish.gbs.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;


import javax.xml.crypto.Data;
import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(String userId);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(String userId);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    String selectUserRoles(String appId) throws DataAccessException;

    User selectByUniqueKey(String appId) throws DataAccessException;

    User selectByIdPassword(String appId, String password) throws DataAccessException;

    List<User> selectUserList() throws DataAccessException;

    List<User> selectUserListByRoleId(Integer roleId) throws DataAccessException;

    List<User> selectUserListExtendByRoleId(Integer roleId) throws DataAccessException;

    /**
     * 根据角色和账号信息查询用户, mybatis 使用注解 @param 传递多个参数
     * @author Joycessh
     * @param roleId
	 * @param name
     * @return java.util.List<com.bigfish.gbs.entity.User>
     * @date 12/12/18 5:39 PM
     */
    List<User> selectUserListByRoleIdAndName(@Param("roleId") Integer roleId, @Param("name") String name) throws DataAccessException;

}